import React from 'react';
import PropTypes from 'prop-types';
import { View, Text } from 'react-native';
import fn from './PlateformHalf';
import { colors } from '../theme';


const InputMsg = ({
  children, rightLabel, onClick,
}) => {
  const Mystyle = {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'space-between',
    height: fn(100),
    borderWidth: 1,
    borderBottomColor: colors.LightGray,
  };
  return (
    <View style={Mystyle}>
      {children}
      <Text style={{ color: colors.Orange, fontSize: fn(28) }} onPress={onClick}>
        {rightLabel}
      </Text>
    </View>
  );
};
/**
 * children 传递子元素
 * rightLabel 右边
 */

InputMsg.defaultProps = {
  onClick: null,
  rightLabel: '',
  children: null,
};
InputMsg.propTypes = {
  /**
   * ### InputMsg 属性说明
   *
   * 展示所有的小图标
   *
   * | Name | Type | Default | Details | isRequired |
   * | ------:| -----------:| -----------: | -----------: | ------:|
   * | rightLabel | string | | 右边文字 | no |
   * | children | object | | 子元素 | no |
   * | onClick | function | | 右边元素事件 | no |
   *
   * ### InputMsg 代码示例(详见示例项目)
   *
   * ```html
   * <InputMsg/>
   * ```
   */
  rightLabel: PropTypes.string,
  children: PropTypes.instanceOf(Object),
  onClick: PropTypes.func,

};

export default InputMsg;
